

init python:

    class Attribute():
        def __init__(self,strInternalName,xValue):
            self.strInternalName = strInternalName
            self.xValue = xValue
            _aAttributes.Append(self)

        def GetInternalName(self):
            return self.strInternalName
            
        def SetValue(self,xValue):
            self.xValue = xValue
        
        def GetValue(self): 
            return self.xValue
            
        def Verify(self): 
            return True

    class IntAttribute(Attribute):
        def __init__(self,strInternalName,iValue=0,iMin=None,iMax=None):
            Attribute.__init__(self,strInternalName,iValue)
            self.iMin = iMin
            self.iMax = iMax
        
        def Add(self,iAdd):
            self.xValue = self.xValue + iAdd
            self.Verify()
            
        def Verify(self): 
            if self.iMin is not None:
                self.xValue = max((self.iMin,self.xValue,))
            if self.iMax is not None:
                self.xValue = min((self.iMax,self.xValue,))

        
    class Attributes(dict):  
        def Append(self,pAttribute):
            self[pAttribute.GetInternalName()] = pAttribute
            
        def Get(self,strInternalName):
            if self.has_key(strInternalName):
                return self[strInternalName] 
    
        
    def StandardVerifyFunction(*args,**kwargs):
        return True
        
    class Place:
        def __init__(self,strInternalName,strDisplayName):
            self.strInternalName = strInternalName
            self.strDisplayName = strDisplayName
            self.aChoices = []
            _aPlaces.Append(self)
            
        def GetChoices(self):
            aReturn = []
            for pChoice in self.aChoices:
                if pChoice.Verify():
                    aReturn.append(pChoice)
            return aReturn
        
        def GetDisplayName(self):
            return self.strDisplayName
        
        def GetInternalName(self):
            return self.strInternalName
            
        def AddChoice(self,strName,strJumpLabel,pVerifyFunction=StandardVerifyFunction):
            self.aChoices.append(Choice(strName,strJumpLabel,pVerifyFunction))
            
            
    class Choice:
        def __init__(self,strJumpLabel,strName,pVerifyFunction=StandardVerifyFunction):
            self.strName = strName
            self.strJumpLabel = strJumpLabel
            self.pVerifyFunction = pVerifyFunction
            
        def GetDisplayName(self):
            return self.strName
            
        def GetLabel(self):
            return self.strJumpLabel
        
        def Verify(self):
            return self.pVerifyFunction()

    _aAttributes = Attributes()
    _aPlaces = Attributes()
